package com.enlorenz.core.channel.common.message.imp;

import com.enlorenz.common.util.CommonContants;
import com.enlorenz.common.util.ExceptionUtils;
import com.enlorenz.core.channel.common.message.IWriteStatusMessage;

/**
 * 写出状态消息的实现
 * @author Karma
 */
public class WriteStatusMessage implements IWriteStatusMessage{
	//是否成功
	private Boolean success;
	//消息源
	private Object srcMessage;
	//异常信息
	private Exception exception;
	
	public Object getSrcMessage() {
		return srcMessage;
	}
	public void setSrcMessage(Object srcMessage) {
		this.srcMessage = srcMessage;
	}
	public Exception getException() {
		return exception;
	}
	public void setException(Exception exception) {
		this.exception = exception;
	}
	public void setSuccess(Boolean success) {
		this.success = success;
	}
	@Override
	public boolean isSuccess() {
		return success;
	}
	
	public String toString(){
		return "发送成功["+success+"],源消息["+srcMessage+"],异常["+CommonContants.WRAP_SYMBOL+ExceptionUtils.getExpStr(exception)+"]";
	}
}
